﻿@using Helpers;
@using MvcDatagrid.Models;

@model IEnumerable<MvcDatagrid.Models.Images>

@{
    ViewBag.Title = "KODisplayPictures";
}
 <div id="pictureModels" style="visibility: hidden; display: none" >
        @Html.Raw(Json.Encode(Model));
 </div>

<h2>KODisplayPictures</h2>
<div>
    <div class="img-list-container">
        <div class="img-list">
            <ul id="pagination" data-bind="template: { name: membersTemplate, foreach: modelOnLoad }">
                <li>
                </li>
            </ul>
        </div>
        <div id="pager"></div>
    </div>
</div>

<script type="text/javascript">
    function PicturesArrayViewModel() {
        this.modelOnLoad = ko.observableArray(pictures);
        this.AddModel = function (data) {
            this.modelOnLoad.push();
        }
    }
    function FillWithPictureViewModel() {
        var pictures = jsonParse($("#pictureModels").text());
    }

    ko.applyBindings(new PicturesArrayViewModel());
    $(function () {
        FillWithPictureViewModel();
    });
</script>